<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 定义阶乘函数
        var foo = function fun(a) {
            var mul = 1;
            for (i = 1 ; i <= a ; i++) {
                mul *= i;
            }
            return mul;
        };
        // 调用函数
        for (j = 100 ; j <= 999 ; j++) {
            var str = j.toString();
            var bai = parseInt(str.charAt(0)),
                shi = parseInt(str.charAt(1)),
                ge = parseInt(str.charAt(2));
            if (foo(bai) + foo(shi) + foo(ge) === j) {
                console.log(j);
            }
        }
    </script>
</head>
<body>
    
</body>
</html>